home *** CD-ROM | disk | FTP | other *** search
- /* *****************************************************************************
- *
- * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- *
- ***************************************************************************** */
- #include "fast.h"
- #include "event.h"
- #include "device.h"
-
- extern void do_quit(), do_rightmouse(), display(), ShowFast();
- extern void this_run(), that_run(), this_quit(), do_reset(), do_shuffle();
-
- int mainmenu, quitmenu;
-
- extern int x_size, y_size;
-
- Init(name)
- char *name;
- {
- keepaspect(1, 1);
- prefsize(ZOOM_FACTOR*x_size+2*BORDER,ZOOM_FACTOR*y_size+2*BORDER);
- {
- char *t, *strrchr();
- winopen((t=strrchr(name, '/')) != NULL ? t+1 : name);
- }
-
- wintitle("PSORT-QSORT");
-
- add_event(ANY, REDRAW, ANY, display, NULL);
- qdevice(REDRAW);
-
- add_event(ANY, ESCKEY, UP, do_quit, NULL);
- qdevice(ESCKEY);
-
- add_event(ANY, WINQUIT, ANY, do_quit, NULL);
- qdevice(WINQUIT);
-
- add_event(ANY, RIGHTMOUSE, DOWN, do_rightmouse, NULL);
- qdevice(RIGHTMOUSE);
-
- RGBmode();
- doublebuffer();
- gconfig();
-
- shademodel(FLAT);
-
- do_reset();
- CreateMenus();
- }
-
- char str[64];
- CreateMenus() {
-
- mainmenu = defpup("Psort-Qsort %t|Reset %f|Shuffle %f|------|Run Qsort %f|Run Psort %f|------|Quit %f",
- do_reset, do_shuffle, this_run , that_run, this_quit);
-
- quitmenu = defpup("Quit %t|Really %f|Cancel %f",
- do_quit, ShowFast);
- }
-